#include <cstdio>
#include <cstring>

int main( )
{
    char num[ 100 ];
    int n, p, i, t, l, sum;
    while ( scanf("%d", &n) != EOF )
    {
        sum = 0;
        while ( n-- )
        {
            scanf("%s", num);
            l = strlen( num );
            t = num[ l - 2 ] - '0';
            if ( t == 0 )
            {
                t = 10;
                l--;
            }
            p = 0;
            for ( i = 0; i < l - 3; i++ )
                p = p * t + num[ i ] - '0';
            sum += p;
        }
        printf("%d\n", sum);
    }
    return 0;
}
